Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYA-112608: add grouping with absolute, relative, world flags. #1600

Merged
merged 7 commits into from
Jul 29, 2021

Conversation

HamedSabri-adsk
Copy link
Contributor

grouping_flags

@HamedSabri-adsk HamedSabri-adsk added ufe-usd Related to UFE-USD plugin in Maya-Usd workflows Related to in-context workflows labels Jul 25, 2021
@HamedSabri-adsk HamedSabri-adsk requested a review from ppt-adsk July 25, 2021 16:35
Ufe::SceneItem::Ptr
createGroup(const Ufe::Selection& selection, const Ufe::PathComponent& name) const override;
#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding guards against UFE v0.3.5 since selection is no longer passed to group command.

@@ -76,7 +85,7 @@ void UsdUndoCreateGroupCommand::execute()
_groupCompositeCmd->append(setKindCmd);
setKindCmd->execute();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the plugin side, we only need to create the groupItem and set its Kind.

On the Maya side, the insertion (a.k.a move ) happens with support for different flag options.

if ufeUtils.ufeFeatureSetVersion() >= 3:
cmds.undo()
else:
groupCmd.undo()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test now uses the cmds::undo() and cmds::redo() instead of groupCmd.

@@ -107,6 +116,7 @@ void UsdUndoCreateGroupCommand::execute()

throw; // re-throw the same exception
}
#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

groupItem selection is now handled on the Maya side.

return std::make_shared<UsdUndoCreateGroupCommand>(parentItem, selection, name);
#endif
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these UFE V3 guards should be cleaned up after switching to UFE V3.

@ppt-adsk ppt-adsk requested a review from pierrebai-adsk July 26, 2021 20:46
@@ -99,7 +130,7 @@ def testUsdGroup(self):
self.assertEqual("ballset.usda", layer.GetDisplayName())
stage.SetEditTarget(layer)

if (ufeUtils.ufeFeatureSetVersion() >= 3):
if (os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') > '3000'):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guard against UFEV3.1.

@@ -124,7 +155,7 @@ def testUsdGroup(self):

# The command will now append a number 1 at the end to match the naming
# convention in Maya.
if (ufeUtils.ufeFeatureSetVersion() >= 3):
if (os.getenv('UFE_PREVIEW_VERSION_NUM', '0000') > '3000'):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guard against UFEV3.1.

pass
# TODO: for some strange reasons the globalSelection returns 0??
# I tried the same steps in interactive Maya and it correctly returns 2
# self.assertEqual(len(globalSelection), 2)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ppt-adsk I am going to investigate this tomorrow morning. For some odd reasons the globalSelection length after undo is reported az 0. This can't be true, since there are 2 items in selection after undo.

I tried the exact same steps in interactive Maya and it all behaves as expected.

stage.GetPrimAtPath("/group1/Sphere1"),
stage.GetPrimAtPath("/group2"),
stage.GetPrimAtPath("/group2/Sphere2"),
stage.GetPrimAtPath("/group2/Sphere3")])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simple test to verify world flag.

When this flag is enabled, the new group is put under the world.

- verify undo/redo
# no TRS attributes
self.assertFalse(newspherePrim.HasAttribute('xformOp:translate'))
self.assertFalse(newspherePrim.HasAttribute('xformOp:rotateXYZ'))
self.assertFalse(newspherePrim.HasAttribute('xformOp:scale'))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple test to verify relative flag

@HamedSabri-adsk
Copy link
Contributor Author

@ppt-adsk Maya sides of changes was merged in this morning. Thanks to @fowlertADSK

@HamedSabri-adsk
Copy link
Contributor Author

Looks like PF passed on all machines but "2020 Linux python2" and "2022 Linux python2" machines failed to launch mysteriously.

Error: remote build /job/https://ecg-jenkins.ecs.ads.autodesk.com/job/ecg-mayausd-branch-preflight-2022-linux/661 failed to launch

marking this as Ready-To-Merge.

@HamedSabri-adsk HamedSabri-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jul 28, 2021
@kxl-adsk kxl-adsk merged commit 20157a2 into dev Jul 29, 2021
@kxl-adsk kxl-adsk deleted the sabrih/MAYA-112608/support_grouping branch July 29, 2021 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge Development process is finished, PR is ready for merge ufe-usd Related to UFE-USD plugin in Maya-Usd workflows Related to in-context workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants